{% extends "sqliscan/base.html" %}

{% block title %}DSScan{% endblock %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <i class="glyphicon glyphicon-search"></i>
            SCAN 开启扫描
        </div>

        <div class="panel-body">

            {% if submit %}
                <div class="panel panel-default">
                    <div class="panel-body">
                        <span class="text-success">Success! Scanning ... Please Wait ... </span>
                    </div>
                </div>

                <a href="{% url "scan" %}">
                    <button type="submit" class="btn btn-default navbar-right" >
                        <span class="col-lg-1"><span class="glyphicon glyphicon-backward"> Return</span></span>
                    </button>
                </a>

                <a href="{% url "task" %}">
                    <button type="submit" class="btn btn-default navbar-right" value="scan">
                        <span class="col-lg-1"><span class="glyphicon glyphicon-tasks"> Task</span></span>
                    </button>
                </a>

            {% else %}
            <form id="form" class="form-horizontal" method="post">

            {% csrf_token %}

            <button class="btn btn-danger" type="submit" id="btnDelete" name="btn" value="btnDelete">
                <span class="glyphicon glyphicon-trash"></span>
                    Delete <i class="fa fa-minus"></i>
            </button>

            <button class="btn btn-danger" type="submit" id="btnScan" name="btn" value="btnScan">
                <span class="glyphicon glyphicon-search"></span>
                    Scan <i class="fa fa-minus"></i>
            </button>

            <table class="table table-striped table-hover" id="datatable-default">

            <colgroup>
                <col style="width:2%">
         	    <col style="width:85%">
{#         	    <col style="width:20%">#}
         	</colgroup>

            <thead>
                <tr>
                <th><input type="checkbox" name="checkAll" id="checkAll"/></th>
                <th>URL</th>
{#                <th>DELETE</th>#}
                </tr>
            </thead>
            <tbody>
                {% for task in tasks %}
                    {% if not task.task_id %}
                    <tr>
                    <td><input type="checkbox" name="checkbox" id="checkbox" value="{{ task.target_url }}"/></td>
                    <td>{{ task.target_url }}</td>
                    </tr>
                    {% endif %}
                {% endfor %}
            </tbody>
            </table>
            </form>
            {% endif %}
        </div>

    </div>
{% endblock %}


